﻿using System;
using System.Collections.Generic;
using System.IO;
using ProjScan.RecordManager.AssetData;
using ProjScan.Tools;
using UnityEditor;
using UnityEngine;

namespace ProjScan.RecordManager
{
	// Token: 0x02000288 RID: 648
	internal class SerializedObjectRecordManager : RecordManagerBase<SerializedObjectAssetData>
	{
		// Token: 0x06001125 RID: 4389 RVA: 0x0005086C File Offset: 0x0004EA6C
		public override void PrepareAssets()
		{
			this.datas = new List<SerializedObjectAssetData>();
			int num = AssetPathManager.Instance.prefabPathList.Length;
			for (int i = 0; i < num; i++)
			{
				string text = AssetPathManager.Instance.prefabPathList[i];
				this.ActiveAllRecord();
				bool flag = this.CheckAssetPathRules(text);
				if (flag)
				{
					int id = AssetPathManager.Instance.GetID(Path.GetDirectoryName(text));
					GameObject gameObject = AssetDatabase.LoadAssetAtPath(text, typeof(GameObject)) as GameObject;
					foreach (Component component in gameObject.GetComponents<Component>())
					{
						SerializedObjectAssetData serializedObjectAssetData = new SerializedObjectAssetData(id, component, new List<string>());
						serializedObjectAssetData.id = this.datas.Count;
						this.ValidateAsset(serializedObjectAssetData);
						this.datas.Add(serializedObjectAssetData);
						bool flag2 = this.datas.Count % 100 == 0;
						if (flag2)
						{
							ToolsHelper.GC();
						}
					}
				}
			}
		}

		// Token: 0x17000384 RID: 900
		// (get) Token: 0x06001126 RID: 4390 RVA: 0x00050978 File Offset: 0x0004EB78
		public override string TableTag
		{
			get
			{
				return "PrefabReference";
			}
		}
	}
}
